<?php
include '../c/config.php';
$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqli->error);}
 
 
$table='s8';
$query=$mysqli->query("SELECT * FROM `".$table."` WHERE fen is NULL  limit 0,1 ");
while ($list=$query->fetch_assoc()) {
      $dan=(int)$list['fendan'];
      $duo=(int)$list['fenduo'];
      $tian=(int)$list['fentian'];
      $fen=$dan+$duo+$tian;

        $sql="update `".$table."` set fen=".$fen." WHERE id='".$list['id']."'";
        $mysqli->query($sql);
        echo $sql;
       echo "<br/>";
       echo "$dan $duo $tian :",($dan+$duo+$tian);
 
   
}
 
 
?>
<script type="text/javascript">
    window.setTimeout(function(){
         window.location.reload();
    }, 200);

</script>


 